<template>
<div style="padding:13px;height:100%;">
    <el-tabs type="border-card" style="width:100%;height:160px;">
        <!-- 多条件 -->
        <el-tab-pane label="搜索条件">
            <el-form :inline="true" :model="formInline" class="demo-form-inline" size="mini">
                <el-form-item label="行政区划: ">
                    <el-cascader :options="options" v-model="selectedOptions" @change="xin"/>
                </el-form-item>
                <el-form-item label="兴办主体: ">
                    <el-select v-model="formInline.establishmentofthesubject" placeholder="-全部-">
                        <el-option label="省级民政部门" value="省级民政部门"/>
                        <el-option label="市级民政部门" value="市级民政部门"/>
                        <el-option label="县级民政部门" value="县级民政部门"/>
                        <el-option label="乡镇人民政府(含地区办事处)" value="乡镇人民政府(含地区办事处)"/>
                        <el-option label="街道办事处" value="街道办事处"/>
                        <el-option label="单位、企业或社会组织" value="单位、企业或社会组织"/>
                        <el-option label="与境外合资、合作" value="与境外合资、合作"/>
                        <el-option label="境外独资" value="境外独资"/>
                        <el-option label="村委会" value="村委会"/>
                        <el-option label="居委会" value="居委会"/>
                        <el-option label="个人" value="个人"/>
                    </el-select>
                </el-form-item>
                <el-form-item label="主体性质: ">
                    <el-select v-model="formInline.mainproperties" placeholder="-全部-">
                        <el-option label="公办公营" value="公办公营"/>
                        <el-option label="公办民营" value="公办民营"/>
                    </el-select>
                </el-form-item>
                <el-form-item label="医疗服务方式: ">
                    <el-select v-model="formInline.modeofmedicalservice" placeholder="-请选择-">
                        <el-option label="内设医疗机构(自我医疗保障)" value="内设医疗机构(自我医疗保障)"/>
                            <el-option label="与医疗机构合作(协议医疗保障)" value="与医疗机构合作(协议医疗保障)"/>
                            <el-option label="未开展" value="未开展"/>
                    </el-select>
                </el-form-item>
                <el-form-item label="机构名称: ">
                    <el-input v-model="formInline.jigouname"/>
                </el-form-item>
                <el-form-item label="机构类别: ">
                    <el-select v-model="formInline.institutionscategory" placeholder="-请选择-">
                        <el-option label="自理型养老机构(主要接收自理老年人)" value="自理型养老机构(主要接收自理老年人)"/>
                        <el-option label="护理型养老机构(主要接收失能老年人)" value="护理型养老机构(主要接收失能老年人)"/>
                        <el-option label="综合型养老机构(主要接收自理老年人和失能老年人)" value="综合型养老机构(主要接收自理老年人和失能老年人)"/>
                    </el-select>
                </el-form-item>
                <el-form-item label="是否具备医保定点资格: ">
                    <el-select v-model="formInline.isdesignatedhealthcare" placeholder="-请选择-">
                        <el-option label="是" value="是"/>
                        <el-option label="否" value="否"/>
                    </el-select>
                </el-form-item>

                <el-form-item>
                    <el-button @click="seachFirst" type="success" icon="el-icon-search">搜索</el-button>
                    <el-button @click="refresh" icon="el-icon-refresh-right" size="mini" plain>刷新</el-button>
                </el-form-item>
            </el-form>
        </el-tab-pane>
    </el-tabs>
    <div style="padding:10px 0px 0px 0px;width:100%;">
        <div id="map" class="map"></div>
    </div>
    <!-- 新增 查看 修改 框 -->
    <el-dialog :title="zzz?'新建':ccc?'查看':'修改'" :fullscreen="true" :visible.sync="dialogVisible" :modal="false" @close="refresh">
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm" label-width="160px" size="mini" :inline="true">
            <el-tabs type="card">
                <!-- 基本信息 -->
                <el-tab-pane><span slot="label"><i class="el-icon-user"></i> 基本信息</span>
                    <el-row>
                        <el-col :span="11">
                            <el-form-item label="机构名称: " prop="jigouname">
                                <el-input v-model="ruleForm.jigouname" :disabled="ccc" :maxlength="16" show-word-limit/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="开办时间: " prop="createdate">
                                <el-date-picker v-model="ruleForm.createdate" :disabled="ccc" type="date" format="yyyy/MM/dd" value-format="yyyy-MM-dd"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="行政区划: " prop="administrativedivision">
                                <el-cascader :options="options" v-model="selected" :disabled="ccc" @change="sss"/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="组织机构代码/统一社会信用代码: " prop="creditcode">
                                <el-input v-model="ruleForm.creditcode" :disabled="ccc" :maxlength="18" show-word-limit/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="23">
                            <el-form-item label="设立许可证: " prop="establishmentpermit">
                                <el-radio-group v-model="ruleForm.establishmentpermit" :disabled="ccc">
                                    <el-radio label="有"/>
                                    <el-radio label="无"/>
                                </el-radio-group>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="23">
                            <el-form-item label="原因: " prop="reasons" v-if="ruleForm.establishmentpermit=='无'">
                                <el-checkbox-group v-model="ruleForm.reasons" :disabled="ccc">
                                    <el-checkbox label="无相关消防审核意见" name="type">无相关消防审核意见</el-checkbox>
                                    <el-checkbox label="无相关食药监意见" name="type">无相关食药监意见</el-checkbox>
                                    <el-checkbox label="无相关环评意见" name="type">无相关环评意见</el-checkbox>
                                    <el-checkbox label="其他____" name="type">其他____</el-checkbox>
                                </el-checkbox-group>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="兴办主体: " prop="establishmentofthesubject">
                                <el-select v-model="ruleForm.establishmentofthesubject" placeholder="-请选择-" :disabled="ccc">
                                    <el-option label="省级民政部门" value="省级民政部门"/>
                                    <el-option label="市级民政部门" value="市级民政部门"/>
                                    <el-option label="县级民政部门" value="县级民政部门"/>
                                    <el-option label="乡镇人民政府(含地区办事处)" value="乡镇人民政府(含地区办事处)"/>
                                    <el-option label="街道办事处" value="街道办事处"/>
                                    <el-option label="单位、企业或社会组织" value="单位、企业或社会组织"/>
                                    <el-option label="与境外合资、合作" value="与境外合资、合作"/>
                                    <el-option label="境外独资" value="境外独资"/>
                                    <el-option label="村委会" value="村委会"/>
                                    <el-option label="居委会" value="居委会"/>
                                    <el-option label="个人" value="个人"/>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="是否投保养老机构责任险: " prop="liabilityinsurance">
                                <el-radio-group v-model="ruleForm.liabilityinsurance" :disabled="ccc">
                                    <el-radio label="是"/>
                                    <el-radio label="否"/>
                                </el-radio-group>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="特困人员供养机构类型: " prop="extremelyneedysupporttype">
                                <el-select v-model="ruleForm.extremelyneedysupporttype" placeholder="-请选择-" :disabled="ccc">
                                    <el-option label="农村特困人员供养服务机构(农村敬老院等)" value="农村特困人员供养服务机构(农村敬老院等)"/>
                                    <el-option label="城市特困人员供养服务机构(福利院)" value="城市特困人员供养服务机构(福利院)"/>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="主体性质: " prop="mainproperties">
                                <el-select v-model="ruleForm.mainproperties" placeholder="-请选择-" :disabled="ccc">
                                    <el-option label="公办公营" value="公办公营"/>
                                    <el-option label="公办民营" value="公办民营"/>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="机构类别: " prop="institutionscategory">
                                <el-select v-model="ruleForm.institutionscategory" placeholder="-请选择-" :disabled="ccc">
                                    <el-option label="自理型养老机构(主要接收自理老年人)" value="自理型养老机构(主要接收自理老年人)"/>
                                    <el-option label="护理型养老机构(主要接收失能老年人)" value="护理型养老机构(主要接收失能老年人)"/>
                                    <el-option label="综合型养老机构(主要接收自理老年人和失能老年人)" value="综合型养老机构(主要接收自理老年人和失能老年人)"/>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="机构性质: " prop="institutionsnature">
                                <el-select v-model="ruleForm.institutionsnature" placeholder="-请选择-" :disabled="ccc">
                                    <el-option label="民办养老机构" value="民办养老机构"/>
                                    <el-option label="公办养老机构" value="公办养老机构"/>
                                    <el-option label="个人" value="个人"/>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="法人性质: " prop="legalnature">
                                <el-select v-model="ruleForm.legalnature" placeholder="-请选择-" :disabled="ccc">
                                    <el-option label="社会团体(民办非企业)法人" value="社会团体(民办非企业)法人"/>
                                    <el-option label="事业单位法人" value="事业单位法人"/>
                                    <el-option label="工商企业法人" value="工商企业法人"/>
                                    <el-option label="未经法人登记" value="未经法人登记"/>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="医疗服务方式: " prop="modeofmedicalservice">
                                <el-select v-model="ruleForm.modeofmedicalservice" placeholder="-请选择-" :disabled="ccc">
                                    <el-option label="内设医疗机构(自我医疗保障)" value="内设医疗机构(自我医疗保障)"/>
                                    <el-option label="与医疗机构合作(协议医疗保障)" value="与医疗机构合作(协议医疗保障)"/>
                                    <el-option label="未开展" value="未开展"/>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="23">
                            <el-form-item label="是否具备医保定点资格: " prop="isdesignatedhealthcare">
                                <el-radio-group v-model="ruleForm.isdesignatedhealthcare" :disabled="ccc">
                                    <el-radio label="是"/>
                                    <el-radio label="否"/>
                                </el-radio-group>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="23">
                            <el-form-item label="房屋性质: " prop="housetype">
                                <el-radio-group v-model="ruleForm.housetype" :disabled="ccc">
                                    <el-radio label="自有产权"/>
                                    <el-radio label="租赁"/>
                                    <el-radio label="合作使用"/>
                                    <el-radio label="其他"/>
                                </el-radio-group>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="是否获取卫生部门颁发的护理院执业许可证: " prop="nursinghomepermit">
                                <el-radio-group v-model="ruleForm.nursinghomepermit" :disabled="ccc">
                                    <el-radio label="是"/>
                                    <el-radio label="否"/>
                                </el-radio-group>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="编制数量: " prop="bianzhi">
                                <el-input v-model="ruleForm.bianzhi" placeholder="只能输入五位以内的正整数" :disabled="ccc" maxlength="5" oninput="value=value.replace(/[^\d]|^[0]/g,'')"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row v-if="ccc">
                        <el-col :span="12">
                            <el-form-item label="添加人: " v-if="ccc" prop="addpeople">
                                <el-input v-model="ruleForm.addpeople" :disabled="ccc"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row v-if="ccc">
                        <el-col :span="12">
                            <el-form-item label="添加时间: " v-if="ccc" prop="addtime">
                                <el-date-picker v-model="ruleForm.addtime" type="datetime" format="yyyy/MM/dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" :disabled="ccc"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="23">
                            <el-form-item label="上传图片: " prop="imgurl">
                                <el-upload
                                    :disabled="ccc"
                                    class="avatar-uploader"
                                    action="http://upload-z1.qiniup.com/"
                                    :show-file-list="false"
                                    :data="ddataa"
                                    :on-success="handleSuccess"
                                    :before-upload="beforeUpload">
                                    <el-input placeholder="选择文件" v-model="showurdl" :disabled="ccc" style="width:460px;">
                                        <template slot="prepend"><el-button @click="uploada" :disabled="ccc">选择文件</el-button></template>
                                    </el-input>
                                </el-upload>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row v-if="ccc||ggg">
                        <el-col :span="23">
                            <img :src="showurdl" width="600px" height="260px" v-if="ccc||ggg"/>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="23">
                            <el-form-item label="上传资质: " prop="zizhi">
                                <el-upload
                                    :disabled="ccc"
                                    class="avatar-uploader"
                                    action="http://upload-z1.qiniup.com/"
                                    :show-file-list="false"
                                    :data="ddatab"
                                    :on-success="handleFile"
                                    :before-upload="beforeFile">
                                    <el-input placeholder="选择文件" v-model="showurl" :disabled="ccc" style="width:460px;">
                                        <template slot="prepend"><el-button @click="uploadb" :disabled="ccc">选择文件</el-button></template>
                                    </el-input>
                                </el-upload>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="经度: " prop="jingdu">
                                <el-input v-model="ruleForm.jingdu" :disabled="ccc"/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="纬度: " prop="weidu">
                                <el-input v-model="ruleForm.weidu" :disabled="ccc"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="23">
                            <el-form-item label="区域定位: " prop="zonelocation">
                                <el-input v-model="ruleForm.zonelocation" :disabled="ccc" style="width:550px;"/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    
                    <div class="map" ref="map">
                        <baidu-map class="bmView" :scroll-wheel-zoom="true" :center="location" :zoom="zoom" @ready="handler" ak="xxx">
                            <bm-view style="width:74%;height:400px;flex:1"/>
                            <bm-marker :position="{lng:location.lng,lat:location.lat}"/><!-- 搜索控件 -->
                            <bm-control>
                                <bm-auto-complete v-model="dddd" :sugStyle="{zIndex:999999}" @confirm="handleConfirm" :disabled="ccc">
                                    <el-input v-model="dddd" placeholder="请输入地址来直接查找相关位置" size="mini" :disabled="ccc" style="width:350px;"><template slot="append">定位</template></el-input>
                                </bm-auto-complete>
                            </bm-control>
                        </baidu-map>
                    </div>

                </el-tab-pane>
        
                <!-- 内部管理信息 -->
                <el-tab-pane label="内部管理信息">
                    <el-form-item v-for="(nn,index) in inner" :key="index">
                        <el-form-item v-if="nn.zbxName=='是否与入住对象签订入住合同: '&&nn.leibie.includes('内部管理')&&nn.kjLeixing=='单选'" :label="nn.zbxName">
                            <el-select v-model="innersss[index]" placeholder="-请选择-" :disabled="ccc">
                                <div v-for="(ss,index) in inners" :key="index">
                                    <el-option :label="ss.zhibiao" :value="ss.noid" v-if="nn.noid==ss.zbId">{{ss.zhibiao}}</el-option>
                                </div>
                            </el-select>
                        </el-form-item>
                        <el-form-item v-else-if="nn.leibie.includes('内部管理')&&nn.kjLeixing=='单选'" :label="nn.zbxName">
                            <el-radio-group v-model="innersss[index]" :disabled="ccc">
                                <span v-for="(ss,index) in inners" :key="index">
                                    <el-radio v-if="nn.noid==ss.zbId" :label="ss.noid">{{ss.zhibiao}}</el-radio>
                                </span>
                            </el-radio-group>
                        </el-form-item>
                    </el-form-item>
                    <el-form-item label="添加人: " v-if="ccc" prop="addpeople">
                        <el-input v-model="ruleForm.addpeople" :disabled="ccc"/>
                    </el-form-item>
                    <el-form-item label="添加时间: " v-if="ccc" prop="addtime">
                        <el-date-picker v-model="ruleForm.addtime" type="datetime" format="yyyy/MM/dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" :disabled="ccc"/>
                    </el-form-item>
                </el-tab-pane>
                 
                <!-- 房屋信息 -->
                <el-tab-pane label="房屋信息">
                    <el-form-item v-for="(nn,index) in inner" :key="index">
                        <el-form-item v-if="nn.leibie.includes('房屋')&&nn.kjLeixing=='单选'" :label="nn.zbxName">
                            <el-radio-group v-model="innersss[index]" :disabled="ccc">
                                <span v-for="(ss,index) in inners" :key="index">
                                    <el-radio v-if="nn.noid==ss.zbId" :label="ss.noid">{{ss.zhibiao}}</el-radio>
                                </span>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item v-else-if="nn.leibie.includes('房屋')&&nn.kjLeixing=='多选'" :label="nn.zbxName">
                            <el-checkbox-group v-model="innersss" :disabled="ccc">
                                <div v-for="(ss,index) in inners" :key="index">
                                    <el-checkbox :label="ss.noid" v-if="nn.noid==ss.zbId">{{ss.zhibiao}}</el-checkbox>
                                </div>
                            </el-checkbox-group>
                        </el-form-item>
                    </el-form-item>
                    <el-form-item label="占地面积(平方米): " prop="floorspace">
                        <el-input v-model="ruleForm.floorspace" :disabled="ccc" placeholder="只能输正整数" maxlength="11" show-word-limit oninput="value=value.replace(/[^\d]|^[0]/g,'')"/>
                    </el-form-item>
                    <el-form-item label="建筑面积(平方米): " prop="coveredarea">
                        <el-input v-model="ruleForm.coveredarea" :disabled="ccc" placeholder="只能输正整数" maxlength="11" show-word-limit oninput="value=value.replace(/[^\d]|^[0]/g,'')"/>
                    </el-form-item>
                    <el-form-item label="兴建投资总额(万元): " prop="grossassets">
                        <el-input v-model="ruleForm.grossassets" :disabled="ccc" placeholder="只能输正整数" maxlength="11" show-word-limit oninput="value=value.replace(/[^\d]|^[0]/g,'')"/>
                    </el-form-item>
                    <el-form-item label="扩建投资总额(万元): " prop="totalexpansioninvestment">
                        <el-input v-model="ruleForm.totalexpansioninvestment" :disabled="ccc" placeholder="只能输正整数" maxlength="11" show-word-limit oninput="value=value.replace(/[^\d]|^[0]/g,'')"/>
                    </el-form-item>
                    <el-form-item label="房屋总数(间): " prop="housenumber">
                        <el-input v-model="ruleForm.housenumber" :disabled="ccc" placeholder="只能输正整数" maxlength="11" show-word-limit oninput="value=value.replace(/[^\d]|^[0]/g,'')"/>
                    </el-form-item>
                    <el-form-item label="单张床位面积(平米): " prop="singlebedarea">
                        <el-input v-model="ruleForm.singlebedarea" :disabled="ccc" placeholder="只能输正整数" maxlength="11" show-word-limit oninput="value=value.replace(/[^\d]|^[0]/g,'')"/>
                    </el-form-item>
                    <el-form-item label="内配卫生间的居室占全部居室房间的比例(%): " prop="bathroomratio">
                        <el-input v-model="ruleForm.bathroomratio" :disabled="ccc" placeholder="只能输正整数" maxlength="11" show-word-limit oninput="value=value.replace(/[^\d]|^[0]/g,'')"/>
                    </el-form-item>
                    <el-form-item label="床位总数(张): " prop="totalnumber">
                        <el-input v-model="ruleForm.totalnumber" :disabled="ccc" placeholder="只能输正整数" maxlength="11" show-word-limit oninput="value=value.replace(/[^\d]|^[0]/g,'')"/>
                    </el-form-item>
                    <el-form-item label="老年人床位总数(张): " prop="oldertotalnumber">
                        <el-input v-model="ruleForm.oldertotalnumber" :disabled="ccc" placeholder="只能输正整数" maxlength="11" show-word-limit oninput="value=value.replace(/[^\d]|^[0]/g,'')"/>
                    </el-form-item>
                    <el-form-item label="残疾人床位总数(张): " prop="remnanttotalnumber">
                        <el-input v-model="ruleForm.remnanttotalnumber" :disabled="ccc" placeholder="只能输正整数" maxlength="11" show-word-limit oninput="value=value.replace(/[^\d]|^[0]/g,'')"/>
                    </el-form-item>
                    <el-form-item label="未成年床位总数(张): " prop="nonagetotalnumber">
                        <el-input v-model="ruleForm.nonagetotalnumber" :disabled="ccc" placeholder="只能输正整数" maxlength="11" show-word-limit oninput="value=value.replace(/[^\d]|^[0]/g,'')"/>
                    </el-form-item>

                    <el-form-item label="添加人: " v-if="ccc" prop="addpeople">
                        <el-input v-model="ruleForm.addpeople" :disabled="ccc"/>
                    </el-form-item>
                    <el-form-item label="添加时间: " v-if="ccc" prop="addtime">
                        <el-date-picker v-model="ruleForm.addtime" type="datetime" format="yyyy/MM/dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" :disabled="ccc"/>
                    </el-form-item>
                </el-tab-pane>
    
                <!-- 设施设备信息 -->
                <el-tab-pane label="设施设备信息">
                    <el-form-item v-for="(nn,index) in inner" :key="index">
                        <el-form-item v-if="nn.leibie.includes('设施')&&nn.kjLeixing=='单选'" :label="nn.zbxName">
                            <el-select v-model="innersss[index]" placeholder="-请选择-" :disabled="ccc">
                                <div v-for="(ss,index) in inners" :key="index">
                                    <el-option :label="ss.zhibiao" :value="ss.noid" v-if="nn.noid==ss.zbId">{{ss.zhibiao}}</el-option>
                                </div>
                            </el-select>
                        </el-form-item>
                        <el-form-item v-else-if="nn.leibie.includes('设施')&&nn.kjLeixing=='多选'" :label="nn.zbxName">
                            <el-checkbox-group v-model="innersss" :disabled="ccc">
                                <div v-for="(ss,index) in inners" :key="index">
                                    <el-checkbox :label="ss.noid" v-if="nn.noid==ss.zbId">{{ss.zhibiao}}</el-checkbox>
                                </div>
                            </el-checkbox-group>
                        </el-form-item>
                    </el-form-item>
                    <el-form-item label="添加人: " v-if="ccc" prop="addpeople">
                        <el-input v-model="ruleForm.addpeople" :disabled="ccc"/>
                    </el-form-item>
                    <el-form-item label="添加时间: " v-if="ccc" prop="addtime">
                        <el-date-picker v-model="ruleForm.addtime" type="datetime" format="yyyy/MM/dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" :disabled="ccc"/>
                    </el-form-item>
                </el-tab-pane>
    
                <!-- 安全管理信息 -->
                <el-tab-pane label="安全管理信息">
                    <el-form :model="ruleFormcc" :rules="rules" ref="ruleFormcc" class="demo-ruleFormcc" label-width="160px" size="mini" :inline="true">
                        <el-row>
                            <el-col :span="11">
                                <el-form-item label="是否建立门卫制度: " prop="ismenwei">
                                    <el-radio-group v-model="ruleFormcc.ismenwei" :disabled="ccc">
                                        <el-radio label="是">是</el-radio>
                                        <el-radio label="否">否</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="机构周边是否存在自然灾害隐患: " prop="isanquanyinhuan">
                                    <el-select v-model="ruleFormcc.isanquanyinhuan" placeholder="-请选择-" :disabled="ccc">
                                        <el-option label="泥石流" value="泥石流"/>
                                        <el-option label="洪水" value="洪水"/>
                                        <el-option label="森林火灾" value="森林火灾"/>
                                        <el-option label="否" value="否"/>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="11">
                                <el-form-item label="机构周边是否存在环境污染隐患: " prop="ishuanjingwuran">
                                    <el-radio-group v-model="ruleFormcc.ishuanjingwuran" :disabled="ccc">
                                        <el-radio label="是">是</el-radio>
                                        <el-radio label="否">否</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="是否建立每日食品留样制度: " prop="isliuyang">
                                    <el-radio-group v-model="ruleFormcc.isliuyang" :disabled="ccc">
                                        <el-radio label="是">是</el-radio>
                                        <el-radio label="否">否</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="11">
                                <el-form-item label="有无安排管理部门: " prop="isguanlibumen">
                                    <el-radio-group v-model="ruleFormcc.isguanlibumen" :disabled="ccc">
                                        <el-radio label="是">是</el-radio>
                                        <el-radio label="否">否</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="管理部门负责人姓名: " prop="admname">
                                    <el-input v-model="ruleFormcc.admname" :disabled="ccc" maxlength="9" show-word-limit/>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="11">
                                <el-form-item label="管理部门负责人联系方式: " prop="admphone">
                                    <el-input v-model="ruleFormcc.admphone" :disabled="ccc" maxlength="11" show-word-limit/>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="有无消防管理人员: " prop="isxiaofang">
                                    <el-radio-group v-model="ruleFormcc.isxiaofang" :disabled="ccc">
                                        <el-radio label="有">有</el-radio>
                                        <el-radio label="无">无</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="11">
                                <el-form-item label="消防管理负责人姓名: " prop="firename">
                                    <el-input v-model="ruleFormcc.firename" :disabled="ccc" maxlength="9" show-word-limit/>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="消防管理负责人工作性质: " prop="firetype">
                                    <el-radio-group v-model="ruleFormcc.firetype" :disabled="ccc">
                                        <el-radio label="兼职">兼职</el-radio>
                                        <el-radio label="专职">专职</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="11">
                                <el-form-item label="有无消防安全标识: " prop="isxfbiaoshi">
                                    <el-radio-group v-model="ruleFormcc.isxfbiaoshi" :disabled="ccc">
                                        <el-radio label="有">有</el-radio>
                                        <el-radio label="无">无</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="是否每天开展日间防火巡查: " prop="firedayprotection">
                                    <el-radio-group v-model="ruleFormcc.firedayprotection" :disabled="ccc">
                                        <el-radio label="是">是</el-radio>
                                        <el-radio label="否">否</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="11">
                                <el-form-item label="是否每天开展夜间防火巡查: " prop="firenightprotection">
                                    <el-radio-group v-model="ruleFormcc.firenightprotection" :disabled="ccc">
                                        <el-radio label="是">是</el-radio>
                                        <el-radio label="否">否</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="有无灭火和应急疏散预案: " prop="fireevacuation">
                                    <el-radio-group v-model="ruleFormcc.fireevacuation" :disabled="ccc">
                                        <el-radio label="有">有</el-radio>
                                        <el-radio label="无">无</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="23">
                                <el-form-item label="有无突发事件应急预案(或突发事件应急管理制度): " prop="emergency">
                                    <el-radio-group v-model="ruleFormcc.emergency" :disabled="ccc">
                                        <el-radio label="有">有</el-radio>
                                        <el-radio label="无">无</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row v-if="ccc">
                            <el-col :span="11">
                                <el-form-item label="添加人: " v-if="ccc" prop="addname">
                                    <el-input v-model="ruleFormcc.addname" :disabled="ccc"/>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="添加时间: " v-if="ccc" prop="createtime">
                                    <el-date-picker v-model="ruleFormcc.createtime" type="datetime" format="yyyy/MM/dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" :disabled="ccc"/>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                </el-tab-pane>
            </el-tabs>
        </el-form>
        <span slot="footer" class="dialog-footer">
            <el-divider/>
            <span>XXXX民政养老服务管理系统</span>
        </span>
    </el-dialog>
</div>
</template>
<script>
import axios from 'axios';
import {BMPGL} from "@/utils/bmpgl.js";
import {BaiduMap,BmView,BmMarker,BmControl,BmAutoComplete} from "vue-baidu-map";
import {regionData,CodeToText} from "element-china-area-data";
export default{
    components:{BaiduMap,BmMarker,BmView,BmControl,BmAutoComplete},
    data(){
        return{
            formInline:{
                jigouname:'',
                administrativedivision:'',
                institutionsnature:'',
                mainproperties:'',
                establishmentofthesubject:'',
                extremelyneedysupporttype:'',
                modeofmedicalservice:'',
                institutionscategory:'',
                isdesignatedhealthcare:'',
                pageNum:1,
                pageSize:11,
            },
            tableData:[],
            options:regionData,
            selectedOptions:[],
            ak:"clrGNt0NjtG4EcGLVb4Ta3I0hcFkSmZx",  //百度的地图密钥

            inner:[],   //指标项
            inners:[],  //指标项值
            innersss:[],//增改的指标值

            //上传
            ddataa:{key:"",token:""}, //图片
            ddatab:{key:"",token:""}, //资质
            showurdl:'',
            showurl:"",

            // 百度地图
            BMap:null,
            location:{lng:108.3444553,lat:22.81879829,},
            zoom:15,
            keyWord:"",
            dddd:'',

            // 行政区划
            options:regionData,
            selectedOptions:[], //多选
            selected:[],        //回显
            
            ccc:false,//查看
            zzz:false,//新建
            ggg:false,//修改
            dialogVisible:false,

            ruleForm:{// 基本信息
                noid:'',
                jigouname:'',     //机构名称
                createdate: '',   //创办时间
                administrativedivision:'',    //行政区划
                creditcode:'',                //社会信用代码
                establishmentpermit:'',       //是否有设立许可证 1:是,0:否
                reasons:[],                    //未持有设立许可证原因
                establishmentofthesubject:'',   //兴办主体
                liabilityinsurance:'',          //是否投保养老机构责任险 1:是,0:否
                extremelyneedysupporttype:'',   //特困人员供养机构类型
                mainproperties:'',          //主体性质
                institutionscategory:'',    //机构类别
                institutionsnature:'',    //机构性质
                legalnature:'',           //法人性质
                modeofmedicalservice:'',      //医疗服务方式
                isdesignatedhealthcare:'',    //是否具有定点医保资格 1:有 0:无
                housetype:'',           //房屋性质
                nursinghomepermit:'',   //是否获得卫生部门颁发的护理院职业许可证 1:是 0:否
                bianzhi:'',   //编制数量
                imgurl:'',    //图片文件地址
                zizhi:'',     //资质文件地址
                weidu:'',    //经度
                jingdu:'',   //纬度
                zonelocation:'',    //区域定位
                floorspace:'',      //占地面积
                coveredarea:'',     //建筑面积
                grossassets:'',     //兴建投资总额
                totalexpansioninvestment:'',    //扩建投资总额
                housenumber:'',     //房屋总数
                singlebedarea:'',   //单张床位面积
                bathroomratio:'',   //内配卫生间的居室占全部居室房间的比例
                totalnumber:'',     //床位总数
                oldertotalnumber:'',      //老年人床位总数
                remnanttotalnumber:'',    //残疾人床位总数
                nonagetotalnumber:'',     //未成年床位总数
                addpeople:'',   //添加人
                addtime:'',     //添加时间
            },
            ruleFormcc:{// 安全管理
                ismenwei:'',   //是否建立门卫制度 1:是,0:否
                isxfbiaoshi:'',       //有无消防安全标识 1:有,0:无
                isanquanyinhuan:'',     //机构周边是否存在自然灾害隐患 1:泥石流 ,3:洪水 ,5:森林火灾, 0:否
                ishuanjingwuran:'',   //机构周边是否存在环境污染隐患 1:是,0:否
                isliuyang:'',   //是否建立每日食品留样制度 1:是,0:否
                isguanlibumen:'',      //有无安排管理部门 1:是,0:否
                admname:'',     //管理部门负责人姓名
                admphone:'',    //管理部门负责人联系方式
                isxiaofang:'',   //有无消防管理人员 1:是,0:否
                firename:'',    //消防管理负责人姓名
                firetype:'',    //消防管理负责人工作性质 1:兼职,2:专职
                firedayprotection:'',     //是否每天开展日间防火巡查 1:是,0:否
                firenightprotection:'',   //是否每天开展夜间防火巡查 1:是,0:否
                fireevacuation:'',    //有无灭火和应急疏散预案 1:是,0:否
                emergency:'',     //有无突发事件应急预案(或突发事件应急管理制度) 1:有,0:无
                addname:'',     //添加人
                createtime:'',  //创建时间
            },
            rules:{
                jigouname:[
                    {required:true,message:'请输入机构名称',trigger:'change'}
                ],
                createdate:[
                    {required:true,message:'请选择日期',trigger:'change'}
                ],
                administrativedivision:[
                    {required:true,message:'请选择行政区划',trigger:'change'}
                ],
                creditcode:[
                    {required:true,message:'请输入社会信用代码',trigger:'change'}
                ],
                establishmentpermit:[
                    {required:true,message:'是否有设立许可证',trigger:'change'}
                ],
                reason:[
                    {required:true,message:'请选择未持有设立许可证原因',trigger:'change'}
                ],
                establishmentofthesubject:[
                    {required:true,message:'请选择兴办主体',trigger:'change'}
                ],
                liabilityinsurance:[
                    {required:true,message:'是否投保养老机构责任险',trigger:'change'}
                ],
                extremelyneedysupporttype:[
                    {required:true,message:'请选择特困人员供养机构类型',trigger:'change'}
                ],
                mainproperties:[
                    {required:true,message:'请选择主体性质',trigger:'change'}
                ],
                institutionscategory:[
                    {required:true,message:'请选择机构类别',trigger:'change'}
                ],
                institutionsnature:[
                    {required:true,message:'请选择机构性质',trigger:'change'}
                ],
                legalnature:[
                    {required:true,message:'请选择法人性质',trigger:'change'}
                ],
                modeofmedicalservice:[
                    {required:true,message:'请选择医疗服务方式',trigger:'change'}
                ],
                isdesignatedhealthcare:[
                    {required:true,message:'是否具有定点医保资格',trigger:'change'}
                ],
                housetype:[
                    {required:true,message:'请选择房屋性质',trigger:'change'}
                ],
                nursinghomepermit:[
                    {required:true,message:'是否获得卫生部门颁发的护理院职业许可证',trigger:'change'}
                ],
                bianzhi:[
                    {required:true,message:'请输入编制数量',trigger:'change'}
                ],
                imgurl:[
                    {required:true,message:'上传图片',trigger:'change'}
                ],
                zizhi:[
                    {required:true,message:'上传资质文件',trigger:'change'}
                ],
                jingdu:[
                    {required:true,message:'请输入经度',trigger:'change'}
                ],
                weidu:[
                    {required:true,message:'请输入纬度',trigger:'change'}
                ],
                zonelocation:[
                    {required:true,message:'请输入区域定位',trigger:'change'}
                ],
                floorspace:[
                    {required:true,message:'请输入占地面积',trigger:'change'}
                ],
                coveredarea:[
                    {required:true,message:'请输入建筑面积',trigger:'change'}
                ],
                grossassets:[
                    {required:true,message:'请输入兴建投资总额',trigger:'change'}
                ],
                totalexpansioninvestment:[
                    {required:true,message:'请输入扩建投资总额',trigger:'change'}
                ],
                housenumber:[
                    {required:true,message:'请输入房屋总数',trigger:'change'}
                ],
                singlebedarea:[
                    {required:true,message:'请输入单张床位面积',trigger:'change'}
                ],
                bathroomratio:[
                    {required:true,message:'请输入内配卫生间的居室占全部居室房间的比例',trigger:'change'}
                ],
                totalnumber:[
                    {required:true,message:'请输入床位总数',trigger:'change'}
                ],
                oldertotalnumber:[
                    {required:true,message:'请输入老年人床位总数',trigger:'change'}
                ],
                remnanttotalnumber:[
                    {required:true,message:'请输入残疾人床位总数',trigger:'change'}
                ],
                nonagetotalnumber:[
                    {required:true,message:'请输入未成年床位总数',trigger:'change'}
                ],
                ismenwei:[
                    {required:true,message:'请选择是否建立门卫制度',trigger:'change'}
                ],
                isxfbiaoshi:[
                    {required:true,message:'请选择有无消防安全标识',trigger:'change'}
                ],
                isanquanyinhuan:[
                    {required:true,message:'请选择机构周边是否存在自然灾害隐患',trigger:'change'}
                ],
                ishuanjingwuran:[
                    {required:true,message:'请选择机构周边是否存在环境污染隐患',trigger:'change'}
                ],
                isliuyang:[
                    {required:true,message:'请选择是否建立每日食品留样制度',trigger:'change'}
                ],
                isguanlibumen:[
                    {required:true,message:'请选择有无安排管理部门',trigger:'change'}
                ],
                admname:[
                    {required:true,message:'请输入管理部门负责人姓名',trigger:'change'}
                ],
                admphone:[
                    {required:true,message:'请输入管理部门负责人联系方式',trigger:'change'}
                ],
                firename:[
                    {required:true,message:'请输入消防管理负责人姓名',trigger:'change'}
                ],
                isxiaofang:[
                    {required:true,message:'请选择有无消防管理人员',trigger:'change'}
                ],
                firetype:[
                    {required:true,message:'请选择消防管理负责人工作性质',trigger:'change'}
                ],
                firedayprotection:[
                    {required:true,message:'请选择是否每天开展日间防火巡查',trigger:'change'}
                ],
                firenightprotection:[
                    {required:true,message:'请选择是否每天开展夜间防火巡查',trigger:'change'}
                ],
                fireevacuation:[
                    {required:true,message:'请选择有无灭火和应急疏散预案',trigger:'change'}
                ],
                emergency:[
                    {required:true,message:'有无突发事件应急预案(或突发事件应急管理制度)',trigger:'change'}
                ],
            }
        }
    },
    methods:{
        initMap(){
            BMPGL(this.ak).then((BMapGL)=>{
                let map=new BMapGL.Map("map");
                var myGeo=new BMapGL.Geocoder();
                for(let i=0;i<this.tableData.length;i++){//获取初始化定位坐标
                    let dddd=this.tableData[i];
                    let point=new BMapGL.Point(this.location.lng,this.location.lat);
                    let renshu=this.tableData[i].oldertotalnumber+this.tableData[i].remnanttotalnumber+this.tableData[i].nonagetotalnumber;
                    let mianji=this.tableData[i].floorspace;
                    let xiangmi=this.tableData[i].zonelocation;
                    let lianxi=this.tableData[i].admphone;
                    let jianjie=this.tableData[i].jigouname+'工作人员按实行,全院微笑行动,以“有爱心、有热心、有耐心、有细心、有真心、有责任心”的服务理念全心全意为24小时为老人提供服务,中心提供多功能活动中心、健身室、棋牌室、麻将室、图书阅览室、乒乓球室等供老人休闲娱乐.';
                    //机构简介
                    let name=this.tableData[i].jigouname;
                    myGeo.getLocation(new BMapGL.Point(this.tableData[i].jingdu,this.tableData[i].weidu),function(result){
                        var marker=new BMapGL.Marker(point);//创建标注点
                        if(result){
                            var opts={width:560,height:210,title:name,}//信息窗口
                            var infoWindow=new BMapGL.InfoWindow("容纳人数 (人) : "+renshu+'<br/>'+"面积 (平方米) : "+mianji+'<br/>'+"详细地址: "+xiangmi+'<br/>'+"联系方式: "+lianxi+'<br/>'+"机构简介: "+jianjie
                            +'<br/><button id="dfdfs" style="border-radius:3px;" type="button" class="el-button el-button--danger el-button--mini">点击查看</button>',opts);
                            marker.addEventListener("click",function(){
                                map.openInfoWindow(infoWindow,map.getCenter());
                                document.getElementById("dfdfs").addEventListener("click",function(){
                                    window.cccc(dddd);
                                },false);
                            });
                        }
                        map.addOverlay(marker);
                    });
                    map.centerAndZoom(point,12);
                }
                map.enableScrollWheelZoom(true);
                var scaleCtrl=new BMapGL.ScaleControl();
                map.addControl(scaleCtrl);
                var zoomCtrl=new BMapGL.ZoomControl();
                map.addControl(zoomCtrl);
                var cityCtrl=new BMapGL.CityListControl();  
                map.addControl(cityCtrl);
            }).catch((err)=>{
                console.log(err);
            });
        },
        cccc(sss){
            this.xuan(sss);
            this.ccc=true;
            this.dialogVisible=true;
        },
        xuan(sss){
            this.jiben(sss);
            this.basic(sss);
            this.safetym(sss);
        },
        jiben(row){
            this.ruleForm=row;
            let arr=[];
            let addd=[];
            arr=(row.reason||"").split(',')
            for(let i=0;i<arr.length;i++){
                if(arr[i]!==undefined&&arr[i]!==''){
                    addd.push(arr[i]);
                }
            }
            this.ruleForm.reasons=addd;
            let dsd=[];
            let sds=[];
            dsd=(row.administrativedivision||"").split(',')
            for(let i=0;i<dsd.length;i++){
                if(dsd[i]!==undefined&&dsd[i]!==''){
                    sds.push(dsd[i]);
                }
            }
            this.selected=sds;
            this.showurdl=row.imgurl;
            this.showurl=row.zizhi;
        },
        basic(key){
            axios.post("/chain-api/basic/putBasicdata/"+key.noid).then(res=>{
                let ccc=[];
                for(let i=0;i<res.data.data.dsss.length;i++){
                    ccc.push(res.data.data.dsss[i].xzliebiao);
                }
                this.innersss=ccc;
            }).catch(error=>{
                console.log(error);
            });
        },
        safetym(key){
            axios.post("/chain-api/basic/putSafetym/"+key.noid).then(res=>{
                console.log(res.data.data.dsss);
                for(let i=0;i<res.data.data.dsss.length;i++){
                    this.ruleFormcc=res.data.data.dsss[i];
                }
            }).catch(error=>{
                console.log(error);
            });
        },

        //指标项值
        addSeach(){
            axios.post("/chain-api/basic/addInfo",{headers:{'Content-Type':'application/json;charset=UTF-8'}}).then(res=>{
                this.inner=res.data.data.inner;
                this.inners=res.data.data.inners;
            }).catch(error=>{
                console.log(error);
            });
        },
        handCheck(){//去掉null值
            const aaa=[]
            this.inners.forEach((index)=>{
                if(aaa.length!==index+1){
                    aaa.push(null)
                }
            });
            this.innersss=aaa;
        },

        //行政区划
        xin(value){
            let rrr="";
            for(let i=0;i<value.length;i++){
                rrr+=value[i]+",";
            }
            this.formInline.administrativedivision=rrr;
        },
        sss(value){
            let rrr="";
            for(let i=0;i<value.length;i++){
                rrr+=value[i]+",";
            }
            this.ruleForm.administrativedivision=rrr;
        },

        //七牛云上传
        // 上传图片
        uploada(){
            axios.get("/chain-api/test/upload/lisi233").then(res=>{
                this.ddataa.token=res.data.data.token;
                this.ddataa.key=res.data.data.fname;
            });
        },
        handleSuccess(res,file){
            this.imageUrl=URL.createObjectURL(file.raw);
            this.showurdl="http://rk7j5i2tg.hb-bkt.clouddn.com/"+res.key;
            this.ruleForm.imgurl=this.showurdl;
        },
        beforeUpload(file){
            const isJPG=file.type==='image/jpeg';
            const isLt2M=file.size/1024/1024<2;
            if(!isJPG){
                this.$message.error('上传头像图片只能是 JPG 格式!');
            }
            if(!isLt2M){
                this.$message.error('上传头像图片大小不能超过 2MB!');
            }
            return isJPG&&isLt2M;
        },
        // 上传文件
        uploadb(){
            axios.get("/chain-api/test/upload/lisi233").then(res=>{
                this.ddatab.token=res.data.data.token;
                this.ddatab.key=res.data.data.fname;
            });
        },
        handleFile(res,file){
            this.imageUrl=URL.createObjectURL(file.raw);
            this.showurl="http://rk7j5i2tg.hb-bkt.clouddn.com/"+res.key;
            this.ruleForm.zizhi=this.showurl;
        },
        beforeFile(file){
            const isLt2M=file.size/1024/1024<2;
            if(!isLt2M){
                this.$message.error('上传头像图片大小不能超过 2MB!');
            }
            return isLt2M;
        },

        //百度地图
        handler(BMap){
            this.BMap=BMap;
        },
        handleConfirm({item}){
            this.ruleForm.zonelocation=this.dddd;
            const that=this;
            let queryString=`${item.value.city}${item.value.district}${item.value.business}`;
            var myGeo=new BMap.Geocoder();
            myGeo.getPoint(queryString,function(point){
                if(point){
                    console.log(point);
                    that.ruleForm.jingdu=point.lng;
                    that.ruleForm.weidu=point.lat;
                }
            });
        },
        
        seach(){
            axios.post("/chain-api/basic/selectPageInfo",this.formInline).then(res=>{
                this.tableData=res.data.data.basic.list;
            }).catch(error=>{
                console.log(error);
            });
        },
        seachFirst(){
            this.formInline.pageNum=1;
            this.seach();
            this.initMap();
        },
        refresh(){
            Object.assign(this.$data.formInline,this.$options.data().formInline);
            this.initMap();
            this.seach();
            this.addSeach();
        }
    },
    mounted(){
        this.initMap();
        this.seach();
        this.addSeach();
        window.cccc=this.cccc;
    }
};
</script>
<style type="text/css" scoped>
*{
    font-weight:900;
}
.zhaopian{
    width:100px;
    height:100px;
    float:right;
    margin-right:30px;
}
.map{
    height:650px;
}
</style>